using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       LSAccount_Login_SuccessSender.cs
*@brief      send message LSAccount_Login_Success
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/4/14
*/

//send message LSAccount_Login_Success
public class msgLSAccount_Login_Success
{
    public const int MessageId = (int)LoginServerTypes.MessageType.LSAccount_Login_Success;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public loginserver.UsrLoginSuccess MsgContent = new loginserver.UsrLoginSuccess();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgLSAccount_Login_Success"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='digest'>
	/// Digest.
	/// </param>
	/// <param name='passport'>
	/// Passport.
	/// </param>
	public msgLSAccount_Login_Success(int session_id, dbserver.AccountDigestInfo digest, int passport)
	{
		SessionId = session_id;
		MsgContent.Digest = digest;
		MsgContent.Passport = passport;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of LSAccount_Login_Success</param>
    public static void ProcessMessage(msgLSAccount_Login_Success msg)
    {
        //TODO
        //Main Message:  msgLoginServer
		msgLoginServer mainMsg = new msgLoginServer(msg.SessionId, msgLSAccount_Login_Success.MessageId, ProtoNet<loginserver.UsrLoginSuccess>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
